package ch.sv7.tool.dbmanager.db;

import java.util.HashMap;
import java.util.Iterator;

public class Row {

	private HashMap map;

	public Row() {
		map = new HashMap();
	}

	public Field getField(String fieldName) {
		return (Field) map.get(fieldName);
	}

	public void addField(Field field) {
		map.put(field.getName(), field);
	}

	public String toString() {
		String result = "  Row : ";
		for (Iterator iter = map.keySet().iterator(); iter.hasNext();) {
			String fieldName = (String) iter.next();
			Field field = getField(fieldName);
			if (field != null)
				result = result + field.toString();
		}

		return result;
	}
}
